﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL.Users;
using BLL.Users.Impl;
using Utils;
public partial class Page_Security_ResetPasswordaspx : System.Web.UI.Page
{
    string userID = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["userId"] != null)
        {
            userID = Request.QueryString["userId"].ToString();
        }
    }


    protected void btnChangePasswordSubmit_Click(object sender, ImageClickEventArgs e)
    {
        UserBO userBO = new UserBOImpl();
        //获取数据
        string NewPasswordconfirm = txtChangePasswordNewPasswordConfirm.Text.ToString();
        //封装数据
        User user = new User
        {
            UserId = userID,
        };
        //修改密码
        string result = userBO.setPassword(user, NewPasswordconfirm);
        Response.Write(WebUtil.GetTipsAndRedirect(result, WebUtil.GetCurrentPath(Request.Url) + "Home.aspx"));
    }
    protected void btnChangePasswordBack_Click(object sender, ImageClickEventArgs e)
    {
        Response.Write("<script language=javascript>history.go(-2);</script>");
    }
}